Skip to content

feat: unlimited pending sign txs whitelist#31

Merged
olga24912 merged 14 commits intoomni-mainfrom
unlimited_txs
Apr 17, 2026
Merged

feat: unlimited pending sign txs whitelist#31
olga24912 merged 14 commits intoomni-mainfrom
unlimited_txs

Conversation

@olga24912
Copy link
Copy Markdown

OmniBridge acts as the sender for all withdraw transactions. Previously, an account could only have one pending-sign transaction at a time — it had to wait for MPC signing to complete before creating another. This became a bottleneck for
OmniBridge, which needs to submit new withdrawals in parallel while existing ones are still being signed.

  • Replaced btc_pending_sign_id: Option with btc_pending_sign_ids: HashSet to support multiple pending-sign transactions per account.
  • Added unlimited_txs_white_list — a DAO-managed whitelist of accounts that can bypass the single-pending-tx restriction. Non-whitelisted accounts retain the original behavior.

Comment thread contracts/satoshi-bridge/src/account.rs
Comment thread contracts/satoshi-bridge/src/api/bridge.rs Outdated
Comment thread contracts/satoshi-bridge/src/account.rs Outdated

pub fn internal_get_account(&self, account_id: &AccountId) -> Option<&Account> {
self.data().accounts.get(account_id).map(Into::into)
pub fn internal_get_account(&self, account_id: &AccountId) -> Option<Account> {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we return cloned version now?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just decided to implement a lazy account migration. If we request mut, we upgrade the account to the new version. If it’s view, we convert it locally. Because of this approach, we can’t return a reference, since a conversion happens.

As an alternative, we could implement a separate migration function and migrate accounts in batches. But I kind of like the lazy approach more.

@olga24912 olga24912 requested review from frolvanya and karim-en April 13, 2026 10:37
Comment thread contracts/satoshi-bridge/src/api/management.rs Outdated
Comment thread contracts/satoshi-bridge/src/chain_signature.rs
Comment thread contracts/satoshi-bridge/src/account.rs Outdated
Comment thread contracts/satoshi-bridge/src/account.rs Outdated
@olga24912 olga24912 requested a review from karim-en April 15, 2026 18:02
@olga24912 olga24912 merged commit b6a4725 into omni-main Apr 17, 2026
1 check passed
olga24912 added a commit that referenced this pull request Apr 17, 2026
* option -> hashset

* add whitelist for unlimited txs

* add migration test

* lazy migration for accoun

* fix lint

* add limit for unlimited txs

* check whitelist everywhere

* whitelist set -> map

* remove new config

* fmt

* renaming

* remove unwrap_account function

* unite set and reset pendig tx list

* get_account ref
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants